<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<sql:query var="rs" dataSource="jdbc/TestDB">
    select id, category, template from question
</sql:query>

<table cellspacing="0" cellpadding="0" border="0" style="" class="dataTable" id="type_table">
    <thead>
        <tr>
            <th style="width:5%;" class="sorting_disabled">PSP</th>
            <th class="sorting_disabled">Category</th>
            <th class="sorting_disabled">Question</th>
        </tr>
    </thead>
    <tbody>
        <c:forEach var="row" items="${rs.rows}">

            <tr  >
                <td><input style="display:none" name="myid" type="checkbox" title="Click anywhere of this question to select this question type. You can choose more than one question types." value=${row.id}>${row.id}</td>
                <td title="Click anywhere of this question to select this question type. You can choose more than one question types.">${row.category}</td>
                <td>${row.template}</td>
            </tr>

        </c:forEach> 

    </tbody>
</table>

<script type="text/javascript"><!--
    $(document).ready(function() {    

        $('#type_table tr').click( function() {
            if ( $(this).hasClass('row_selected') ){
                $(this).removeClass('row_selected');
                $(this).find('input[name=myid]').attr('checked', false);
            } else{
                $(this).addClass('row_selected');
                $(this).find('input[name=myid]').attr('checked', true);
            }
        } );

    } )
    //--></script>

